<template>
	<view class="container">
		<view class="tips">
			The amount required to get 1 EXP varies by category.
		</view>
		<view class="col" v-for="(item,index) in list" :key="item.id">
			<view class="item">
				<view class="title">
					<image :src="item.image" mode=""></image>{{item.card_title}}
				</view>
				<view class="content">
					<view class="text">
						Card sub-Category
					</view>
					<view class="text">
						per 1 EXP
					</view>
				</view>
				<view class="content" v-for="(ite,index2) in item.exp_list" :key="ite.id">
					<view class="text">
						{{ite.category_name}}
					</view>
					<view class="text">
						{{ite.exp}}{{ite.category_unit}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				this.$post("/index/get_exp_list").then(res => {
					console.log(res)
					this.list = res.data
				})
			},
		}
	}
</script>

<style lang="scss">
	.container {
		padding: 30rpx;
		font-size: 26rpx;
	}

	.tips {
		margin-bottom: 20rpx;
	}

	.col {
		padding: 8rpx;

		.item {
			border: 1px solid #DBDBDD;
			padding: 20rpx;
		}

		.title {
			display: flex;
			margin-bottom: 16rpx;

			image {
				width: 60rpx;
				margin-right: 20rpx;
				height: 42rpx;
			}
		}

		.content {
			display: flex;
			flex-wrap: wrap;

			.text {
				width: 50%;
				text-align: center;
				padding: 10rpx;
			}
		}
	}
</style>